<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/pagination.tld" prefix="page"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

String type= (String)request.getAttribute("type");
	if(null==type){
		type = "1";
	}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<TITLE>听力语言康复教学教师备课系统</TITLE>
		<META http-equiv=Content-Type content="text/html; charset=gb2312">
		<META content="MSHTML 6.00.6000.16705" name=GENERATOR>
		<script type="text/javascript" src="<%=path %>/reference/js/jquery.js"></script>
		<link href="<%=path %>/reference/css/Beike.css" rel="stylesheet" type="text/css">
		<script type="text/javascript">
			function editcontent(tid){
				
				document.getElementById("subbtton").src="<%=path %>/reference/images/button_save.gif";
				document.getElementById("frm").action="<%=path %>/beike/jitimubiao.do?method=editLingYuContact&tid="+tid;
				$("#contact").val($("#td"+tid).text());
				
			}
			function delcontent(tid){
				
				if(window.confirm("确定要删除吗？")){
					window.location.href="<%=path %>/beike/jitimubiao.do?method=delLingYuContact&tid="+tid+"&type=${areaType}&edit=${edit }&targetId=${targetId}";
				}
			}
		
		</script>
	</HEAD>
	<BODY>
	<form action="<%=path %>/beike/jitimubiao.do?method=addLingYuContact" name="frm" method="post">
	<!-- 标记为编辑目标时 -->
	<input type="hidden" name="edit" value="${edit }">
	<input type="hidden" name="targetId" value="${targetId }">
	<input type="hidden" name="type" value="<%=request.getParameter("type") %>" />
		<div id="div1" style="margin: 0px">
              <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#cfe5f5">
				<tr>
				  <td width="6%" height="25" bgcolor="#a4c9ec">&nbsp;</td>
				  <td width="66%" height="25" align="center" bgcolor="#a4c9ec"><strong>目标内容</strong></td>
				  <td width="11%" align="center" bgcolor="#a4c9ec"><strong>编 辑</strong></td>
				  <td width="17%" align="center" bgcolor="#a4c9ec"><strong>删 除</strong></td>
				</tr>
				<c:forEach items="${list}" var="content" varStatus="statu">
					<tr>
					  <td width="6%" height="30" bgcolor="#FFFFFF">${statu.count+(currPage-1)*pageSize }.</td>
					  <td height="30" align="center" bgcolor="#FFFFFF" id="td${content.id }">${content.areaContent }</td>
					  <td height="30" align="center" bgcolor="#FFFFFF"><a href="javascript:editcontent(${content.id });"><img src="<%=path %>/reference/images/bianji.gif" alt="" width="16" height="16" border="0"></a></td>
					  <td height="30" align="center" bgcolor="#FFFFFF"><a href="javascript:delcontent(${content.id });"><img src="<%=path %>/reference/images/de.gif" alt="" width="16" height="16" border="0"></a></td>
					</tr>
				</c:forEach>
				</table>
				<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
				  <tr>
					<td bgcolor="#e6f0f8"><table width="100%" border="0" cellspacing="0" cellpadding="3">
					  <tr>
						<td align="right">
							<%
								String url = "/beike/jitimubiao.do?method=initMubiao&type="+type;
								if(null!=request.getAttribute("targetId")){
									url = "/beike/jitimubiao.do?method=editMubiaoContent&type="+type+"&edit=1&targetId="+request.getAttribute("targetId");
								}
								request.setAttribute("url",url);
								
							 %>
							<page:Pagination url="${pageContext.request.contextPath}${url}" currPage="${empty currPage?1:currPage}" pageAmount="${pageAmount}" pageSize="${empty pageSize?10:pageSize}" type="post" form="frm" />
						</td>
					  </tr>
					</table></td>
				  </tr>
				</table>
            </div>
             <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
                <tr>
                  <td bgcolor="#e6f0f8"><table width="100%" border="0" cellspacing="0" cellpadding="3">
                      <tr>
                        <td width="68%" align="right"><input type="text" id="contact" name="contact" style="width:100%"></td>
                        <td width="32%"><img src="<%=path %>/reference/images/button_add.gif" id="subbtton" onClick="frm.submit()" width="44" height="20" border="0" style="cursor:hand"></td>
                      </tr>
                  </table></td>
                </tr>
              </table>
            </form>
        </BODY>
    </HTML>